package com.tomehay.termprojectmanage_server.mapper;

import com.tomehay.termprojectmanage_server.pojo.Model.Course;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tomehay
 * @since 2023-06-20
 */
public interface CourseMapper extends BaseMapper<Course> {
    Course selectOneById(@Param("id") Integer id);
    @Select("SELECT course.* " +
            "from course,course_clazz,student,clazz " +
            "WHERE student.id = #{id} and course.course_status = #{status} and student.clazz_id = clazz.id and" +
            " course_clazz.clazz_id = clazz.id AND course.id = course_clazz.course_id")
    List<Course> SelectByStudentID(int id,int status);


}
